import request from '@/utils/request'
import Qs from 'qs'

export function listBeginningInventory(query) {
  return request({
    url: '/Inventory/listBeginningInventory',
    method: 'get',
    params: query,
    paramsSerializer: function(params) {
      return Qs.stringify(params, { arrayFormat: 'repeat' })
    }
  })
}

export function listInventoryPurchase(query) {
  return request({
    url: '/Inventory/listInventoryPurchase',
    method: 'get',
    params: query,
    paramsSerializer: function(params) {
      return Qs.stringify(params, { arrayFormat: 'repeat' })
    }
  })
}

export function addInventoryPurchase(data) {
  return request({
    url: '/Inventory/addInventoryPurchase',
    method: 'post',
    data
  })
}

export function updateInventoryPurchase(data) {
  return request({
    url: '/Inventory/updateInventoryPurchase',
    method: 'post',
    data
  })
}


export function deleteInventoryPurchase(data) {
  return request({
    url: '/Inventory/deleteInventoryPurchase',
    method: 'post',
    data
  })
}


export function listInventory(query) {
  return request({
    url: '/Inventory/listInventory',
    method: 'get',
    params: query,
    paramsSerializer: function(params) {
      return Qs.stringify(params, { arrayFormat: 'repeat' })
    }
  })
}

export function updateBeginning(data) {
  return request({
    url: '/Inventory/updateBeginning',
    method: 'post',
    data
  })
}
